package com.muli.muwai.dao;



import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muli.muwai.entity.Financing;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;


@Mapper
public interface FinancingDao extends BaseMapper<Financing> {
    @Insert({"<script>INSERT INTO financing(`trace_id`, `contract_id`, `order_commencement_date`, " +
            "`filiale`, `retail`, `erp_numbers`, `project_name`, `starts_amount`, " +
            "`project_sales_number`) VALUES " +
            "<foreach collection='list' item='item' index='index' separator=','>"+
            "(#{item.trace_id}, #{item.contract_id}, #{item.order_commencement_date}, " +
            "#{item.filiale}, #{item.retail}, #{item.erp_numbers}, #{item.project_name}, #{item.starts_amount}, #{item.project_sales_number})"+
            "</foreach>"+
            "</script>"
    })
   // @SelectKey(statement = "SELECT LAST_INSERT_ID",keyProperty = "id",before = false,resultType = Long.class) //返回自增主键用
    int insertList(List<Financing> list);
}
